import { createStore } from 'vuex'

//状态仓库,用于组件结构复杂时,让每个组件都能简单地获取状态,不要当作缓存来用

export default createStore({
  state: {
    user:null,
    userProfile:null,
    showLogin:false,
  },
  getters: {
  },
  mutations: {
    setUser (state,userInfo) {
      state.user = userInfo
    },
    setUserProfile (state,userProfile) {
      state.userProfile = userProfile
    },
    setShowLogin (state,show){
      state.showLogin = show
    },
  },
  actions: {
  },
  modules: {
  }
})
